/*
 * @Author: yuanchenxi 836909158@qq.com
 * @Date: 2024-07-24 18:33:32
 * @LastEditors: wanghuan wanghuan@sgsimulation.com
 * @LastEditTime: 2024-09-02 08:37:32
 * @FilePath: \SGFEM\DataStructure\FEM\Element\include\CONRODData.h
 */
#pragma once
#include "DataStructure/Common/DataStructureExport.h"
#include "DataStructure/Common/DataStructureNamespace.h"
#include "DataStructure/Common/Id.h"
#include "DataStructure/Common/Real.h"
#include "DataStructure/Input/Element/ElementBase.h"
#include "DataStructure/Input/Solver/DOFDirections.h"

SG_DATASTRUCTURE_FEM_NAMESPACE_OPEN
/// @brief 杆单元定义
///
/// 单元具有两个节点，能够拥有拉压和扭转变形能力。截面属性不会沿着截面轴线变化
struct DECLSPEC CONRODData : public ElementBase
{
    SG::DataStructure::Common::Id   m_g[2]     = { 0, 0 };  ///< nodes' id
    SG::DataStructure::Common::Id   m_mId      = 0;         ///< 材料属性
    SG::DataStructure::Common::Real m_A        = 0.0;       ///< cross section's area
    SG::DataStructure::Common::Real m_J        = 0.0;       ///< torsion coefficient
    SG::DataStructure::Common::Real m_C        = 0.0;       ///< 扭转切应力系数
    SG::DataStructure::Common::Real m_NSM      = 0.0;       ///< non structural mass
    SG::DataStructure::Common::Id   m_domainId = 0;

    /// @brief 杆单元激活自由度
    DofSet GetActiveDofs () const;
};

/// @brief 判断单元数据是否相等
DECLSPEC bool operator== (const CONRODData &a, const CONRODData &b);

SG_DATASTRUCTURE_FEM_NAMESPACE_CLOSE